﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Qreed.Windows.Forms
{
    public partial class WizardPage : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WizardPage"/> class.
        /// </summary>
        public WizardPage()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Gets the wizard form.
        /// </summary>
        /// <value>The wizard form.</value>
        public WizardForm WizardForm { get; internal set; }

        /// <summary>
        /// Occurs when the page is set active.
        /// </summary>
        [Category("Wizard")]
        public event EventHandler<WizardPageActivatedEventArgs> SetActive;

        /// <summary>
        /// Occurs when the next button has been pressed.
        /// </summary>
        [Category("Wizard")]
        public event EventHandler<WizardPageEventArgs> WizardNext;

        /// <summary>
        /// Occurs when the back button has been pressed.
        /// </summary>
        [Category("Wizard")]
        public event EventHandler<WizardPageEventArgs> WizardBack;

        /// <summary>
        /// Occurs when the finish button has been pressed.
        /// </summary>
        [Category("Wizard")]
        public event CancelEventHandler WizardFinish;

        /// <summary>
        /// Occurs when cancel button has been pressed.
        /// </summary>
        [Category("Wizard")]
        public event CancelEventHandler WizardCancel;

        /// <summary>
        /// Raises the <see cref="E:SetActive"/> event.
        /// </summary>
        /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param>
        protected virtual void OnSetActive(WizardPageActivatedEventArgs e)
        {
            if (SetActive != null)
                SetActive(this, e);
        }

        internal void onSetActive(WizardPageActivatedEventArgs e) { OnSetActive(e); }

        /// <summary>
        /// Raises the <see cref="E:WizardNext"/> event.
        /// </summary>
        /// <param name="e">The <see cref="WizardPageEventArgs"/> instance containing the event data.</param>
        protected virtual void OnWizardNext(WizardPageEventArgs e)
        {
            if (WizardNext != null)
                WizardNext(this, e);
        }

        internal void onWizardNext(WizardPageEventArgs e) { OnWizardNext(e); }

        /// <summary>
        /// Raises the <see cref="E:WizardBack"/> event.
        /// </summary>
        /// <param name="e">The <see cref="WizardPageEventArgs"/> instance containing the event data.</param>
        protected virtual void OnWizardBack(WizardPageEventArgs e)
        {
            if (WizardBack != null)
                WizardBack(this, e);
        }

        internal void onWizardBack(WizardPageEventArgs e) { OnWizardBack(e); }

        /// <summary>
        /// Raises the <see cref="E:WizardFinish"/> event.
        /// </summary>
        /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param>
        protected virtual void OnWizardFinish(CancelEventArgs e)
        {
            if (WizardFinish != null)
                WizardFinish(this, e);
        }

        internal void onWizardFinish(CancelEventArgs e) { OnWizardFinish(e); }

        /// <summary>
        /// Raises the <see cref="E:WizardCancel"/> event.
        /// </summary>
        /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param>
        public virtual void OnWizardCancel(CancelEventArgs e)
        {
            if (WizardCancel != null)
                WizardCancel(this, e);
        }

        internal void onWizardCancel(CancelEventArgs e) { OnWizardCancel(e); }
    }
}
